home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-09-19 | 1.1 KB | 39 lines | [TEXT/MEDT] |
- MODULE SystemExample;
-
- (* demonstrates the use of the procedures from module 'System' and module 'FileUtil'. *)
- (* this program is in fact a very small shell, allowing the user to execute other programs *)
- (* or to transfer to another application. *)
-
- FROM System IMPORT Call, Status;
- FROM FileUtil IMPORT GetFileName, Transfer, FType;
- FROM Menu IMPORT MenuRes, SetMenu, GetMenuCmd;
-
- VAR Command : MenuRes;
- Done,Ok : BOOLEAN;
- FileName : ARRAY [0..63] OF CHAR;
- FileType : FType;
- TermReason : Status;
-
- BEGIN
- SetMenu(1,"File|Execute/X|Transfer/T|Quit/Q");
- (* MacMETH sets the type of the object files it creates to 'MOBJ' *)
- FileType := "MOBJ";
- LOOP
- GetMenuCmd(Command,Done);
- IF Done & (Command.menuID = 1) THEN
- CASE Command.menuCmd OF
- 1 : GetFileName(FileName,FileType,Ok);
- IF Ok THEN
- Call(FileName,FALSE,TermReason);
- IF (TermReason # normal) THEN
- (* Some error occured *)
- END (* IF *);
- END (* IF *)
- |2 : Transfer("")
- |3 : EXIT
- END (* CASE *);
- END (* IF *)
- END (* LOOP *)
- END SystemExample.
-
-